The program "KeyMap" distributed with tn3270 may be used to either redefine the keyboard mappings in tn3270, or add additional mappings. "KeyMap" reads a text file which defines a mapping, and converts the mapping to the resource format used by tn3270. The resulting resource may be added to tn3270, may replace an existing resource in tn3270, or may be written in "Rez" file format compatible with MPW.
To assist in generating keyboard mappings, KeyMap includes the ability to display the ASCII and raw keycodes generated by a given key. To use this feature, select "Display Keystroke Information" from the "File" menu.
To add or replace a mapping:
1. Choose an existing mapping definition similar to the mapping you wish to create, and open it with a text editor such as TeachText, BBEdit, or the MPW SHELL. The files "default.kbmap", "numeric.kbmap", "library.kbmap", and "deutsch.kbmap" are provided with KeyMap. They correspond to the mapping in the distributed version of tn3270.
2. Edit the file to change the key mapping as desired. Comments at the start of the ".keymap" files provided with tn3270 document the file format.
3. To replace an existing mapping, make the operand of the "name:" line in the definition file the name of the mapping to be replaced. To add a new mapping, make the operand of "name:" a new name. The operand of the "number:" line need not be changed, since it is only used when mappings are saved in "Rez" file format.
4. Double-click on KeyMap, choose "Open definition file" from the "File" menu, and open the mapping file that was just editted. KeyMap will read the file and check for errors. If KeyMap reports any errors, you must quit from KeyMap and correct them before continuing.
5. Choose "Write resource to existing file" from the "File" menu. When the standard file dialog appears, choose the copy of tn3270 you wish to update.
6. KeyMap will add the new mapping to tn3270. If an existing mapping is being replaced, KeyMap will ask you to confirm the replacement before continuing.
Note: The current version of KeyMap does not provide a method of deleting mappings from tn3270. Although adding and replacing mapping will usually be sufficient, mappings may be deleted by using ResEdit. The keyboard mappings are resource type GFKB, and tn3270 accesses them by name only. In order to function correctly, tn3270 must always include a resource of type GFKB named "default".